using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.RecipeFramework;
using VSSDKAssist.Assets.Actions.Base;
using System.Globalization;

namespace VSSDKAssist.Recipes.CreateVSCommand
{
	/// <summary>
	/// Action that adds BitmapDefinition section on the ctc file
	/// </summary>
	public class CreateBitmapDefinitionAction : ActionBase
	{
		#region Properties
		private string commandName;

		/// <summary>
		/// Gets or sets the name of the command.
		/// </summary>
		/// <value>The name of the command.</value>
		[Input(Required = true)]
		public string CommandName
		{
			get { return commandName; }
			set { commandName = value; }
		}

		private string bitmapDefinition;

		/// <summary>
		/// Gets or sets the bitmap definition.
		/// </summary>
		/// <value>The bitmap definition.</value>
		[Output]
		public string BitmapDefinition
		{
			get { return bitmapDefinition; }
			set { bitmapDefinition = value; }
		}
		#endregion

		/// <summary>
		/// Called when [execute].
		/// </summary>
		protected override void OnExecute()
		{
			// Bitmap                          Bitmap Index, Bitmap Index, ...
			// guidShowMyToolWindowBitmap:bitmapidShowMyToolWindow, 1;

			bitmapDefinition =
				string.Format(
					CultureInfo.CurrentCulture,
					"    guid{0}Bitmap:bitmapid{1}, 1;",
					this.commandName,
					this.commandName);
		}
	}
}